Skip to content

Conversation

@tjzel
Copy link
Collaborator

@tjzel tjzel commented Oct 16, 2025

Required for

Summary

This PR is an ongoing effort to reduce the impact of Reanimated and Worklets in web bundles and to simplify the logic of platform-dependent code.

The ideal solution is to have native-only files with a .native.ts extension and web only files with just .ts extension alongside them. However, currently we also have .web.ts files, which can be problematic in some environments. We want to transition to .native.ts files gradually.

This PR does a few things:

  • It edits TSConfigs alongside the repository. By default we specify that accepted extensions are .native.ts, .ios.ts, .android.ts, .ts (obviously also .tsx etc.). This means that when in IDE we click go to source we'll go to a .native file which is the most common use case for us. Also types for type-checking will be pulled like this.

  • We add additional TSConfigs for web types. These extensions ignore .native .etc. extensions and accept .web extensions. You can switch to those TSConfigs for web type-checking in your IDE.

  • Adding type checking scripts and CI checks for web types.

  • Fixing (or ignoring) all current problems with web types - i.e. mismatching web and native types in Reanimated.

  • Amending eslint configs to properly work in this setup.

Test plan

CI

Base automatically changed from @tjzel/monorepo/root-deps to main October 16, 2025 16:00
@tjzel tjzel marked this pull request as ready for review October 22, 2025 08:40
Copy link
Contributor

@patrycjakalinska patrycjakalinska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two small things:
yarn.lock changes after installing deps on you branch

also, when i run web-example i get:

Web Bundling failed 118ms apps/web-example/index.js (1 module)
 ERROR  index.js: Package subpath './babel' is not defined by "exports" in /Users/marcysia/swm/repos/react-native-reanimated/node_modules/react-strict-dom/package.json

@tjzel
Copy link
Collaborator Author

tjzel commented Oct 22, 2025

@patrycjakalinska

two small things:
yarn.lock changes after installing deps on you branch
also, when i run web-example i get:
...

Are you sure? Everything is okay on my end. Moreover, if yarn.lock were stale it would've been picked up on CI. Have you tested the latest commit on the PR?

Copy link
Contributor

@patrycjakalinska patrycjakalinska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can confirm, now everything works 🪨

@tjzel tjzel added this pull request to the merge queue Oct 23, 2025
Merged via the queue into main with commit b14447e Oct 23, 2025
20 checks passed
@tjzel tjzel deleted the @tjzel/fix-web-types branch October 23, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants